const express = require('express')
const apiRouter = express.Router()

//定义get接口
apiRouter.get('/get', (req, res) => {
    const query = req.query
    res.send({
        status: 0,
        msg: 'get请求成功',
        data: query
    })
})
//定义post接口
apiRouter.post('/post', (req, res) => {
    const body = req.body
    res.send({
        status: 0,
        msg: 'post请求成功',
        data: body
    })
})
//定义删除接口
apiRouter.delete('/delete', (req, res) => {
    res.send({
        status: 0,
        msg: 'delete请求成功',
    })
})
module.exports = apiRouter